<#import "../../layout.html" as c>
<#import "../../list_layout.html" as list>
<#assign alertList = []/>
<#assign alertList = alertList + ["公告列表默认显示系统全部公告，按添加时间顺序排列。可通过高级搜索通过分类项索引某分类内的公告并进行编辑。"]/>
<#assign alertList = alertList + ["为了配合前台页面模板的展示规整，公告不可以删除。"]/>
<@c.html title="Index">
<@list.html title="公告管理" subTitle="公告管理" alertList=alertList permi="sys:announce:save" addBtn=true searchHint="请输入标题进行搜索">
</@list.html>
  <!-- ================== 开始页面所需CSS引入 ================== --> 
  <!-- 富文本编辑器 -->
  <link type="text/css" rel="stylesheet" href="${pluginsRoot}ueditor/themes/default/css/ueditor.css">
  <link type="text/css" rel="stylesheet" href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/WdatePicker.css" />
  <link type="text/css" rel="stylesheet" href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/default/datepicker.css" />
  <!-- ================== 开始页面所需CSS引入 ================== -->



  <@shiro.hasPermission name="sys:announce:edit">
  <input type="hidden" id="announceEdit" value="1"/>
  </@shiro.hasPermission>
  <@shiro.hasPermission name="sys:announce:publish">
  <input type="hidden" id="announcePublish" value="1"/>
  </@shiro.hasPermission>
  <@shiro.hasPermission name="sys:announce:back">
  <input type="hidden" id="announceBack" value="1"/>
  </@shiro.hasPermission>
  <@shiro.hasPermission name="sys:announce:del">
  <input type="hidden" id="announceDel" value="1"/>
  </@shiro.hasPermission>
  <@shiro.hasPermission name="sys:announce:view">
  <input type="hidden" id="announceView" value="1"/>
  </@shiro.hasPermission>

  <!-- 开始新增公告模态窗口 -->
  <div class="modal fade" id="addModal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
          <h4 class="modal-title"> 新增公告 <a class="btn btn-info btn-xs m-l-5" role="button" data-toggle="collapse" href="#OperationTips" aria-expanded="true" title="操作提示"><i class="fa fa-exclamation"></i> 提示 </a> </h4>
        </div>
        <div class="modal-body">
          <ul class="collapse in text-info p-b-10 p-l-15" role="tabpanel" id="OperationTips">
            <li>公告标题、公告类型、关联发行人为必填项，请根据表单提示信息正确输入选择。</li>
            <li>附件图片支持jpg、gif、png格式，大小不要超过2M。上传后可通过点击“插入”按钮将图片嵌入到富文本编辑器中进行操作。</li>
          </ul>
          <form class="form-horizontal form-bordered p-0" action="${adminRoot}announce/json/add" id="addForm" method="post" autocomplete="off" data-parsley-validate="true">
            <!--<div class="form-group">-->
              <!--<label class="control-label col-md-2 col-sm-3">标题<i class="f-s-14 text-danger">*</i>&nbsp;:</label>-->
              <!--<div class="col-md-9 col-sm-8">-->
                <!--<input type="text" name="title" class="form-control" placeholder="请输入公告标题" maxlength="30" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，输入内容控制在2-30个字符。"  data-parsley-required="true" data-parsley-length="[2, 30]"/>-->
              <!--</div>-->
            <!--</div>-->
            <div class="form-group">
              <label class="control-label col-md-2 col-sm-3"> 公告类型 &nbsp;:</label>
              <div class="col-md-9 col-sm-8"> <span data-tip="tooltip" data-placement="right">
                          <label class="radio-inline">
                            <input id="addType_2" name="type" type="radio" value="2" checked="">
                            产品公告</label>
                          <label class="radio-inline">
                            <input id="addType_1" name="type" type="radio" value="1">
                            系统公告</label>
                          </span> </div>
            </div>

            <div class="form-group textPublish" >
              <label class="control-label col-md-2 col-sm-3">关联发行人<i class="f-s-14 text-danger">*</i>&nbsp;: </label>
              <div class="col-md-9 col-sm-8">
                <select name="publisherId" class="form-control" data-parsley-required="true" >
                  <option value ="">- 请选择 -</option>
                  <#if publisherList??>
                    <#list publisherList as publisher>
                      <option value ="${publisher.id}">${publisher.name!}</option>
                    </#list>
                  </#if>
                </select>
              </div>
            </div>

            <div class="form-group">
              <label class="control-label col-md-2 col-sm-3"> 公告内容&nbsp;:</label>
              <div class="col-md-9 col-sm-8">
              <textarea id="contentAdd"  class="col-md-12 col-sm-8" name="content" maxlength="200">
                </textarea>
              </div>
            </div>

          </form>
        </div>
        <div class="modal-footer"><a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a><a href="javascript:;" class="btn btn-success" data-loading-text="Loading..." nc-ajax-submit-target="addForm" nc-ajax-submit>确认提交</a></div>
      </div>
    </div>
  </div>
  <!-- 结束新增公告模态窗口 -->

  <!-- 开始编辑公告模态窗口 -->
  <div class="modal fade" id="editModal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
          <h4 class="modal-title"> 编辑公告 <a class="btn btn-info btn-xs m-l-5" role="button" data-toggle="collapse" href="#OperationTipsEdit" aria-expanded="true" title="操作提示"><i class="fa fa-exclamation"></i> 提示 </a> </h4>
        </div>
        <div class="modal-body">
          <ul class="collapse in text-info p-b-10 p-l-15" role="tabpanel" id="OperationTipsEdit">
            <li>公告标题、公告类型、关联发行人为必填项，请根据表单提示信息正确输入选择。</li>
          </ul>
          <form class="form-horizontal form-bordered p-0" action="${adminRoot}announce/json/edit" id="editForm" method="post" autocomplete="off" data-parsley-validate="true">
            <input type="hidden" name="id" value="">
            <!--<div class="form-group">-->
              <!--<label class="control-label col-md-2 col-sm-3">标题<i class="f-s-14 text-danger">*</i>&nbsp;:</label>-->
              <!--<div class="col-md-9 col-sm-8">-->
                <!--<input type="text" name="title" class="form-control" placeholder="请输入公告标题" autocomplete="off" data-tip="tooltip" data-placement="auto" data-original-title="必填项，输入内容控制在2-30个字符。" data-parsley-required="true" data-parsley-length="[2, 30]"/>-->
              <!--</div>-->
            <!--</div>-->
            <div class="form-group">
              <label class="control-label col-md-2 col-sm-3"> 公告类型 &nbsp;:</label>
              <div class="col-md-9 col-sm-8"> <span data-tip="tooltip" data-placement="right">
                          <label class="radio-inline">
                            <input id="editType_2"  name="type" type="radio" value="2" checked="">
                            产品公告</label>
                          <label class="radio-inline">
                            <input id="editType_1"  name="type" type="radio" value="1">
                            系统公告</label>
                          </span> </div>
            </div>
            <div class="form-group textPublish">
              <label class="control-label col-md-2 col-sm-3">关联发行人<i class="f-s-14 text-danger">*</i>&nbsp;: </label>
              <div class="col-md-9 col-sm-8">
                <select id ="publisher" name="publisherId" class="form-control" data-parsley-required="true" >
                  <option value ="">- 请选择 -</option>
                  <#if publisherList??>
                    <#list publisherList as publisher>
                      <option value ="${publisher.id}">${publisher.name!}</option>
                    </#list>
                  </#if>
                </select>
              </div>
            </div>
            <div class="form-group">
              <label class="control-label col-md-2 col-sm-3"> 公告内容&nbsp;:</label>
              <div class="col-md-9 col-sm-8">
              <textarea id="contentEdit"  class="col-md-12 col-sm-8" name="content" maxlength="200">
                </textarea>
              </div>
            </div>
          </form>
          <!-- 结束设置模块-->
        </div>
        <div class="modal-footer"><a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a><a href="javascript:;" class="btn btn-success" data-loading-text="Loading..." nc-ajax-submit-target="editForm" nc-ajax-submit>确认提交</a></div>
      </div>
    </div>
  </div>
  <!-- 结束编辑公告模态窗口 -->


  <!-- ================== 开始页面级JavaScrip调用 ================== --> 
  <!-- 表单checkbox项 -->
  <script src="${pluginsRoot}bootstrap-switch/bootstrap-switch.min.js"></script>
  <!-- 富文本编辑器 -->
  <script src="${pluginsRoot}ueditor/ueditor.config.js"></script>
  <script src="${pluginsRoot}ueditor/ueditor.all.js"></script>
  <script src="${pluginsRoot}ueditor/lang/zh-cn/zh-cn.js"></script>
  <!-- 时间控件 -->
  <script src="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/WdatePicker.js" defer="defer"></script>

  <script src="${jsRoot}propaganda/announce.handle.js"></script>
  <!-- ================== 结束页面级JavaScrip调用 ================== --> 
</@c.html>
